package com.project.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.LinkeBean;
import com.project.mapper.ILinkeMapper;
import com.project.service.ILinkeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author(王思翰)
 * @Description(类的描述)
 * @Date(创建时间) 2021/7/21 16:51
 */
@Service
@Transactional
public class LinkServiceImpl implements ILinkeService {
    @Autowired
    private ILinkeMapper mapper;

    @Override
    public void add(LinkeBean linkeBean) {
        mapper.add(linkeBean);
    }

    @Override
    public void del(int id) {
        mapper.del(id);
    }

    @Override
    public void update(int id, String phone) {
        mapper.update(id,phone);
    }

    @Override
    public LinkeBean findById(int id) {
        return mapper.findById(id);
    }

    @Override
    public PageInfo<LinkeBean> findAll(int pageNO) {
        PageHelper.startPage(pageNO,3);
        PageInfo<LinkeBean> pageInfo=PageInfo.of(mapper.findAll());
        return pageInfo;
    }
}
